<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background: red;
            float: left;
        }
        .box2{
            width: 100px;
            height: 100px;
            background: green;
            float: left;
        }
        .box{
            width: 200px;
            height: 200px;
            background: blue;
        }
        /*  
        1. 父盒子增加一个固定高度 
        2. 在后面的元素上加clean left right both
        3. 后面的兄弟元素自己清除浮动  .clear_box
        4. overflow:hidden  bfc:让浮动元素计算高度
        5. 伪类选择器 ::after{content:""; display:block;}
        */
        /* .container{
            height: 100px;
        } */
        /* .box{
            clear: both;
        } */
         /* .clear_box{
            clear: none;
         } */
          /* .container{
            overflow: hidden;
          } */
    </style>
</head>
<body>
    <div class="container">
        <div class="box1"></div>
        <div class="box2"></div>
        <div class="clear_box"></div>
    </div>

    <div class="box"></div>
</body>
</html>